{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "import sys\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "import re"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "fang = pd.read_csv('hi.csv')\n",
    "#print(fang)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Name</th>\n",
       "      <th>f1</th>\n",
       "      <th>q1</th>\n",
       "      <th>f2</th>\n",
       "      <th>q2</th>\n",
       "      <th>f3</th>\n",
       "      <th>q3</th>\n",
       "      <th>f4</th>\n",
       "      <th>q4</th>\n",
       "      <th>f5</th>\n",
       "      <th>q5</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>桂枝汤</td>\n",
       "      <td>炙甘草</td>\n",
       "      <td>2</td>\n",
       "      <td>生姜</td>\n",
       "      <td>3.0</td>\n",
       "      <td>桂枝</td>\n",
       "      <td>3</td>\n",
       "      <td>芍药</td>\n",
       "      <td>3.0</td>\n",
       "      <td>大枣</td>\n",
       "      <td>12.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>四逆汤</td>\n",
       "      <td>炙甘草</td>\n",
       "      <td>2</td>\n",
       "      <td>干姜</td>\n",
       "      <td>1.5</td>\n",
       "      <td>附子</td>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  Name   f1  q1  f2   q2  f3  q3   f4   q4   f5    q5\n",
       "0  桂枝汤  炙甘草   2  生姜  3.0  桂枝   3   芍药  3.0   大枣  12.0\n",
       "1  四逆汤  炙甘草   2  干姜  1.5  附子   1  NaN  NaN  NaN   NaN"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "fang"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "class Craft():\n",
    "    def __init__(self,in_list):\n",
    "        self.in_list = in_list\n",
    "        pass\n",
    "    \n",
    "    def craft(self):\n",
    "        pass\n",
    "        \n",
    "    \n",
    "    \n",
    "        "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "player_list1 = [['炙甘草',2],['干姜',1.5],['附子',1]]\n",
    "player_list2 = [['炙甘草',4],['干姜',1],['附子',1]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "if '炙甘草' in fang.loc[0]:\n",
    "    print('hi')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'炙甘草'"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "fang.loc[0].f1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "fang.loc[0].str.contains('炙甘草').sum()#这个太好了,可以升级我之前的程序,都有现成写好的方法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Name    桂枝汤\n",
       "f1      炙甘草\n",
       "q1        2\n",
       "f2       生姜\n",
       "q2        3\n",
       "f3       桂枝\n",
       "q3        3\n",
       "f4       芍药\n",
       "q4        3\n",
       "f5       大枣\n",
       "q5       12\n",
       "Name: 0, dtype: object"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "fang.loc[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
